import { Suspense } from "react";
import { ConfigProvider } from "antd";
import { BrowserRouter, Switch } from "react-router-dom";
import { routes, renderRoutes } from "@router";
// import {languages} from '@/constants';
import Loading from "@components/Loading";
// import ErrorBoundary from "@/components/ErrorBoundary";

export default () => (
  <ConfigProvider>
    <BrowserRouter>
      <Suspense fallback={<Loading />}>
        {/* <ErrorBoundary> */}
        <Switch>{renderRoutes(routes)}</Switch>
        {/* </ErrorBoundary> */}
      </Suspense>
    </BrowserRouter>
  </ConfigProvider>
);
